package com.thiswhyme.mail.config;

import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @description: 邮箱配置参数
 * @author: thiswhyme
 * @date: 2021/5/6
 */
@ConfigurationProperties("spring.mail.base-properties")
public class EmailProperties {

    /**
     * 邮件配置
     */
    private Map<String, EmailProperty> properties = new HashMap<>();

    /**
     * 邮件配置
     */
    public static class EmailProperty {

        /**
         * 发件人
         */
        private String from;

        /**
         * 收件人
         */
        private List<String> to;

        /**
         * 抄送人
         */
        private List<String> cc;

        /**
         * 主题
         */
        private String subject;

        public String getFrom() {
            return from;
        }

        public void setFrom(String from) {
            this.from = from;
        }

        public List<String> getTo() {
            return to;
        }

        public void setTo(List<String> to) {
            this.to = to;
        }

        public List<String> getCc() {
            return cc;
        }

        public void setCc(List<String> cc) {
            this.cc = cc;
        }

        public String getSubject() {
            return subject;
        }

        public void setSubject(String subject) {
            this.subject = subject;
        }
    }

    public Map<String, EmailProperty> getProperties() {
        return properties;
    }

    public void setProperties(Map<String, EmailProperty> properties) {
        this.properties = properties;
    }
}
